<?php
class Parser_Html_Youtube extends Parser_Html {
    
    
    public function content()
    {
        $video = $this->_meta('og:video');
        if ( ! $video)
        {
            if (($qs = Arr::get($this->_url_info, 'query')))
            {
                parse_str($qs, $query);
                if (($v_id = Arr::get($query, 'v')))
                {
                    $video = 'http://www.youtube.com/v/'.$v_id.'?version=3&autohide=1';
                }
            }
        }
        return $video;
    }
    
    
    public function author()
    {
        $author = $this->select('#watch-uploader-info > a');
        return isset($author[0]) ? Arr::get($author[0], 'text') : null;
    }
    
    
}